package esercitazione3.tda_RBTree;

import esercitazione3.exceptions.InvalidPositionException;
import esercitazione3.tda_BinaryTree.EmptyTreeException;
import esercitazione3.tda_Dictionary.Entry;
import esercitazione3.tda_Dictionary.InvalidKeyException;

public class RBTree_MainTest {

	/**
	 * @param args
	 * @throws EmptyTreeException 
	 * @throws InvalidPositionException 
	 */
	public static void main(String[] args) throws InvalidPositionException, EmptyTreeException {
		RBTree<Integer, String> tree = new RBTree<Integer, String>();
		try {	
			tree.insert(40, "Gianni");
			tree.insert(40, "Angelo");
			tree.insert(40, "Diego");
			tree.insert(40, "Gianni");
			tree.insert(40, "Angelo");
			tree.insert(40, "Diego");
			tree.insert(40, "Gianni");
			tree.insert(40, "Angelo");
			tree.insert(40, "Diego");
		} catch (InvalidKeyException e) {
			System.out.println(e.toString());
		}
		tree.stampa((RBNode<Entry<Integer, String>>)tree.root());
		System.out.println("Size:	"+tree.size());
	}
	
	
	
}
